import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/HomeView.vue'
import PingTai from '../views/Good_Fabu/PingTaiView.vue'
import Err from '../views/Error/ErrorView.vue'
import GoodTg from '../views/Good_Fabu/GoodTgView.vue'
import Release from '../views/Good_Fabu/ReleaseViwe.vue'
import Goods from '../views/GoodsView.vue'
import Center from '../views/Center/CenterView.vue'
import Gooditem from '../components/Gooditem.vue'
//  -- 规范命名
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    children: [
      {
        path: '/', name: 'goods', component: Goods, children: [
          { path: '/', name: 'gooditem', component: Gooditem }
        ]
      },
      // {path:'/pingtai' , component:PingTai},
      { path: '/goodtg', component: GoodTg },
      { path: '/center', component: Center }
    ]
  },
  {
    path: '/pingtai',
    name: 'fabu',
    component: PingTai,
    children: [
      { path: '/', name: 'goodtg', component: GoodTg },//商品管理
      { path: '/tg', name: 'tg', component: GoodTg },//商品管理
      { path: '/fabu', name: 'fbu', component: Release }//发布商品
    ]
  },
  {
    // 错误页    
    path: '/err',
    name: 'error',
    component: Err
  }
]

const router = new VueRouter({
  routes
})

export default router
